﻿using System;
using System.Data;
using System.Data.SqlClient;
using System.Web;
using System.Web.UI;
using AnyOffice.DAL;
using AnyOffice.Components;
using AnyOffice.Model;

namespace AnyOffice.general.status_bar
{
    public partial class ajax_sms : System.Web.UI.Page 
    {

        protected void Page_Load(object sender, EventArgs e)
        {
            Response.AppendHeader("Expires", DateTime.Now.AddDays(-1.0).ToString("r"));
            Response.AppendHeader("Pragma", "no-cache");
            Response.AppendHeader("Cache-Control", "no-store, no-cache, must-revalidate, post-check=0, pre-check=0");
            SqlConnection conn = new SqlConnection(ConfigManager.ConnectionString);
            conn.Open();
            SmsDao dao = new SmsDao();
            int newTotalNum = 0;
            int onlineNum = 0;
            dao.SmsCheck(conn, base.User.Identity.Name, Request.UserHostAddress, ref newTotalNum, ref onlineNum);
            if (conn.State == ConnectionState.Open)
            {
                conn.Close();
            }
            Response.Write(newTotalNum.ToString() + "-" + onlineNum.ToString());
            Response.End();
        }
 

    }
}
